import request from '@/utils/request'
import store from '@/store'
export const userInfo = () => {
    return request({
        url: '/v1_0/user/profile',
        headers: {
            Authorization: 'Bearer ' + store.state.tokenObj.token
        }
    })
}
export const editProfile = (data) => {
        return request({
            url: '/v1_0/user/profile',
            method: 'patch',
            data
        })
    }
    // 修改用户头像
export const editAvatar = (data) => {

        return request({
            url: '/v1_0/user/photo',
            method: 'patch',
            data
        })
    }
    // 关注用户
export const followUser = (data) => {
    return request({
        url: '/v1_0/user/followings',
        method: 'post',
        data
    })
}
export const unfollowUser = (id) => {
    return request({
        url: '/v1_0/user/followings/' + id,
        method: 'delete'

    })
}